<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>05_BOM操作</title>
</head>
<body>
<button onclick="alert('警告框')">弹出警告</button>
<button onclick="confirm('您确认删除吗？')">弹出确认框</button>
<button onclick="prompt('请输入用户名')">弹出输入框</button>
<script>
    //将参数值转为整数
    console.log(parseInt(6.6));//6
    console.log(parseInt(6.1));//6
    console.log(parseInt('6.5'));//6
    console.log(parseInt('hhhhh'));//NaN
    console.log(parseInt('12h32h45'));//12

    console.log('--------------------------------')
    //将参数值转为浮点数
    console.log(parseFloat(6.6));//6.6
    console.log(parseFloat(6.1));//6.1
    console.log(parseFloat('6.5'));//6.5
    console.log(parseFloat('hhhhh'));//NaN
    console.log(parseFloat('12h32h45'));//12

    console.log('--------------------------------')
    console.log(isNaN('hhhhh'))//true
    console.log(isNaN(6.6))//false
    console.log(isNaN('6.5'))//false
    console.log(isNaN('12h32h45'))//true
    console.log(isNaN(6))//false

    console.log('--------------------------------')
    //将参数值转为字符串
    console.log(String(6.6));//6.6
    console.log(String(6.1));//6.1

</script>
</body>
</html>